package com.srs.backend.controller;

import com.srs.backend.service.ClientService;
import com.srs.backend.utils.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/api/client")
public class ClientController {
    @Resource
    private ClientService clientService;

    @PostMapping("/add/")
    public Result add(@RequestBody Map<String, String> data) {
        return clientService.add(data);
    }

    @PostMapping("/delete/")
    public Result delete(@RequestBody Map<String, String> data) {
        return clientService.delete(data);
    }

    @PostMapping("/modify/")
    public Result modify(@RequestBody Map<String, String> data) {
        return clientService.modify(data);
    }

    @PostMapping("/get/all/")
    public Result getAll() {
        return clientService.getAll();
    }

    @PostMapping("/get/client/info/")
    public Result getClientInfo(@RequestBody Map<String, String> data) {
        return clientService.getClientInfo(data);
    }
}
